package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;

/**
 *@author Team Pronto
 * The code that balances the robot by moving the battery in the center.
 */
public class ProntoBalance {

    Joystick shootStick;
    Jaguar balanceMotor;

    /**
     * @param shootStick The right joystick.
     */
    public ProntoBalance(Joystick shootStick) {
        balanceMotor = new Jaguar(8);
        this.shootStick = shootStick;

    }
    
    /**
     * Uses the buttons (2, 3) on shootStick to move the battery within the robot using a motor.
     */

    public void balance() {

        if (shootStick.getRawButton(3) == true) {
            balanceMotor.set(1.0);
        } else if (shootStick.getRawButton(2) == true) {
            balanceMotor.set(-1.0);
        } else {
            balanceMotor.set(0.0);
        }

    }
}
